
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<style>
	body::-webkit-scrollbar {
		display: none;
	}
</style>
<head>
	<meta charset="UTF-8">
	<title>商城管理</title>
	<div th:replace="header::common_resource"></div>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">商城后台管理</div>
			<ul class="layui-nav layui-layout-left">   </ul>
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item">
				    <a  th:text="|用户:${session.user==null?'':session.user.username}|">
<!--				        	用户${user.name}-->
				    </a>
				</li>
				<li class="layui-nav-item">
				    <a href="javascript:logout()">注销</a>
				</li>
			</ul>
		</div>
		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" >
					<li class="layui-nav-item layui-nav-itemed">
						<a th:data-url="|${#request.getContextPath()}/order/getEchartsPage|"
						   class="site-demo-active">数据统计</a>
					</li>
					<li class="layui-nav-item layui-nav-itemed">
					    <a href="javascript:;">订单管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;"
								   th:data-url="|${#request.getContextPath()}/order/getOrderListPage|"
								   class="site-demo-active">订单处理</a>
							</dd>
						</dl>
					</li>
					<li class="layui-nav-item">
					    <a href="javascript:;">前台管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" 
								class="site-demo-active" 
								th:data-url="|${#request.getContextPath()}/product/getProductListPage|">商品管理</a>
							</dd>
							<dd>
								<a href="javascript:;" class="site-demo-active"
								   th:data-url="|${#request.getContextPath()}/category/getCategoryListPage|">类别管理</a>
							</dd>
						</dl>
					</li>
					<li class="layui-nav-item" th:if="${session.user.getUsername()=='admin'}">
						<a href="javascript:">超级权限</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:"
								   class="site-demo-active"
								   th:data-url="@{/user/getUserListPage}">
									系统用户管理</a>
							</dd>

						</dl>
					</li>
				</ul>
			</div>
		</div>
		<div class="layui-body" style="padding-bottom: 0px;"><!-- 内容主体区域 -->
			<iframe name="rightframe" width="100%" height="100%" th:src="|${#request.getContextPath()}/order/getEchartsPage|" style="border-width: 0px;"></iframe>
		</div>
	</div>
	<script type="text/javascript" th:inline="javascript">
		var $ = layui.jquery;
		var layer = layui.layer;
		var element = layui.element;
		$('.site-demo-active').click(function() {
			window.open($(this).data('url'), "rightframe");
		});
		element.render();// element.init();
		function openURL(url){
			window.open(url, "rightframe");
		}

		function logout() {
			layer.confirm(
					'您确认要退出么',
					{icon:3},
					function() {
						location.href = [[${#request.getContextPath()}]]+'/user/logout';
					}
			);
		}

	</script>
</body>
</html>